//
//  PHAsset+LatestImg.m
//  GetLastPhotoTest
//
//  Created by apple on 17/6/2.
//  Copyright © 2017年 apple. All rights reserved.
//

#import "PHAsset+LatestImg.h"

@implementation PHAsset (LatestImg)
+(PHAsset *)latestAsset
{
    PHFetchOptions *options = [[PHFetchOptions alloc]init];
    options.sortDescriptors = @[[NSSortDescriptor sortDescriptorWithKey:@"creationDate" ascending:NO]];
    PHFetchResult *result = [PHAsset fetchAssetsWithOptions:options];
    return [result firstObject];
}
@end
